//
//  UIView+CornerRadius.m
//  NEWHYSJ
//
//  Created by SH_iOS on 2017/4/29.
//  Copyright © 2017年 SH. All rights reserved.
//

#import "UIView+CornerRadius.h"

@implementation UIView (CornerRadius)
#pragma mark -- 设置button 上下左右都圆角 高效
- (void)setCornerRadius:(CGFloat)cornerRadius bounds:(CGRect)bounds{
    
    
    [self setCornerRadius:cornerRadius bounds:bounds corner:UIRectCornerAllCorners];
    
}
#pragma mark -- 设置button 上下左右 圆角不一样 高效

- (void)setCornerRadius:(CGFloat)cornerRadius bounds:(CGRect)bounds corner:(UIRectCorner)corner{
    
    UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:bounds  byRoundingCorners:corner cornerRadii:CGSizeMake(__I6Width(cornerRadius),__I6Width(cornerRadius))];
    CAShapeLayer *maskLayer = [CAShapeLayer layer];
    maskLayer.frame = bounds;
    maskLayer.path = maskPath.CGPath;
    self.layer.mask = maskLayer;
    
}

@end
